/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-10-13 08:30:36
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2022-12-28 10:49:58
 * @FilePath: \adminstration\src\Common\Modal\TwoModalList\Organization.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { API_LIST } from '../../Api/Api'
import { commonTableList } from '../config'
import { TwoAddBtn, ThrDeleteBtn } from '../options'

export const BeamQualityReport = async ({ upDataEvent, data, Permission }) => {
    let dataList = {
        type: '质检报告',
        hideInSearch: true,
        pageSize: 10,
        params: {},
        classification: 'TableModal',
        get: API_LIST()['getBeamQualityReport'],
        additional: { key: 'BeamProduceRecordUuid', value: 'uuid' },
        options: [
            Permission.findIndex(v => v.uuid === 'f4cf7d76-2c87-4c00-8f54-4487b8b46dba') !== -1 && (
                <TwoAddBtn
                    upDataEvent={upDataEvent}
                    title="添加报告"
                    ThrKey="ThrModal"
                    value="BeamQualityReport"
                    data={data}
                />
            ),
        ],
        columns: [
            {
                title: '原始文件名',
                dataIndex: 'originalName',
                search: false,
                valueType: 'input',
            },

            commonTableList.createUserName,
            commonTableList.createTime,
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 300,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        Permission.findIndex(v => v.uuid === 'bca61c12-4c80-4667-ab19-7eb74e4e1d7c') !== -1 && (
                            <ThrDeleteBtn
                                key="delete"
                                record={record.uuid}
                                upDataEvent={upDataEvent}
                                data={{ key: 'delete', url: 'delBeamQualityReport', title: '删除附件' }}
                            />
                        ),
                    ]
                },
            },
        ],
    }

    return dataList
}
